home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 4 / The Arsenal Files 4 (Arsenal Computer).ISO / ham / sattrk31.tgz / sattrack-3.1.tar / SatTrack / src / sattrack / sattest.c < prev    next >
C/C++ Source or Header  |  1995-03-16  |  5KB  |  110 lines

  1. /******************************************************************************/
  2. /*                                                                            */
  3. /*  Title       : sattest.c                                                   */
  4. /*  Author      : Manfred Bester                                              */
  5. /*  Date        : 17Feb94                                                     */
  6. /*  Last change : 15Mar95                                                     */
  7. /*                                                                            */
  8. /*  Synopsis    : Routines for testing the sattrack code.                     */
  9. /*                                                                            */
  10. /*                                                                            */
  11. /*  SatTrack is Copyright (c) 1992, 1993, 1994, 1995 by Manfred Bester.       */
  12. /*  All Rights Reserved.                                                      */
  13. /*                                                                            */
  14. /*  Permission to use, copy, and distribute SatTrack and its documentation    */
  15. /*  in its entirety for educational, research and non-profit purposes,        */
  16. /*  without fee, and without a written agreement is hereby granted, provided  */
  17. /*  that the above copyright notice and the following three paragraphs appear */
  18. /*  in all copies. SatTrack may be modified for personal purposes, but        */
  19. /*  modified versions may NOT be distributed without prior consent of the     */
  20. /*  author.                                                                   */
  21. /*                                                                            */
  22. /*  Permission to incorporate this software into commercial products may be   */
  23. /*  obtained from the author, Dr. Manfred Bester, 1636 M. L. King Jr. Way,    */
  24. /*  Berkeley, CA 94709, USA. Note that distributing SatTrack 'bundled' in     */
  25. /*  with ANY product is considered to be a 'commercial purpose'.              */
  26. /*                                                                            */
  27. /*  IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, */
  28. /*  SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF   */
  29. /*  THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHOR HAS BEEN ADVISED  */
  30. /*  OF THE POSSIBILITY OF SUCH DAMAGE.                                        */
  31. /*                                                                            */
  32. /*  THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT      */
  33. /*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A   */
  34. /*  PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"      */
  35. /*  BASIS, AND THE AUTHOR HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, */
  36. /*  UPDATES, ENHANCEMENTS, OR MODIFICATIONS.                                  */
  37. /*                                                                            */
  38. /******************************************************************************/
  39.  
  40. #include <stdio.h>
  41.  
  42. #ifndef STDLIB
  43. #include <stdlib.h>
  44. #endif
  45.  
  46. #include "satglobalsx.h"
  47. #include "sattrack.h"
  48.  
  49. /******************************************************************************/
  50. /*                                                                            */
  51. /* doNoradTest: performs precision test of state vectors for various models   */
  52. /*                                                                            */
  53. /*              for reference see:                                            */
  54. /*              "Spacetrack Report No. 3, Models of Propagation for NORAD     */
  55. /*              Element Sets", F. R. Hoots and R. L. Roehrich, December 1980  */
  56. /*                                                                            */
  57. /******************************************************************************/
  58.  
  59. void doNoradTest()
  60.  
  61. {
  62.     double curT, dT;
  63.     int    i;
  64.  
  65.     for (i = 0; i <= 2; i++)
  66.     {
  67.         satPosGl[i] = 0.0;
  68.         satVelGl[i] = 0.0;
  69.     }
  70.  
  71.     printElements();
  72.     checkPropModelType();
  73.  
  74.     printf("\nState vectors for NORAD precision test ");
  75.     printf("with the '%s' model:\n\n",propModel);
  76.     printf("Start time: %15.8f\n\n",epochDay);
  77.  
  78.     printf("   dT           X, Xdot              Y, Ydot              ");
  79.     printf("Z, Zdot\n");
  80.     printf(" [min]         [km, km/s]           [km, km/s]           ");
  81.     printf("[km, km/s]\n\n");
  82.  
  83.     initNorad = TRUE;
  84.  
  85.     for (i = 0; i < 5; i++)
  86.     {
  87.         dT   = 0.25 * (double) i;
  88.         curT = epochDay + dT;
  89.  
  90.         if (propModelType == LOWEARTH)
  91.             getNoradStateVector(curT);
  92.         else
  93.             getStateVector(curT);              /* for now call TLE Mean Model */
  94.  
  95.         printf(" %4.0f   %19.9f  %19.9f  %19.9f\n",dT*1440.0,
  96.                  satPosGl[0],satPosGl[1],satPosGl[2]);
  97.  
  98.         printf("        %19.9f  %19.9f  %19.9f\n\n",
  99.                  satVelGl[0],satVelGl[1],satVelGl[2]);
  100.     }
  101.  
  102.     return;
  103. }
  104.  
  105. /******************************************************************************/
  106. /*                                                                            */
  107. /* End of function block sattest.c                                            */
  108. /*                                                                            */
  109. /******************************************************************************/
  110.